Skip to content

Feat/df 1068: Add 'offline' as status filter option#803

Open
jbarnsley10 wants to merge 3 commits into
mainfrom
feat/df-1068-offline
Open

Feat/df 1068: Add 'offline' as status filter option#803
jbarnsley10 wants to merge 3 commits into
mainfrom
feat/df-1068-offline

Conversation

@jbarnsley10
Copy link
Copy Markdown
Contributor

@jbarnsley10 jbarnsley10 commented May 15, 2026

Ticket DF-1068

NOTE - need a model bump from designer PR DEFRA/forms-designer#1445

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for 'offline' as a status filter option when listing forms. The filter enum is migrated from FormStatus to the new FormFilterStatus (from @defra/forms-model), which includes Offline alongside Draft and Live. The aggregation pipeline and filter conditions are extended to recognise documents with offline: true as the new "offline" status.

Changes:

  • Replace FormStatus with FormFilterStatus in form-listing/filter code paths and corresponding tests.
  • Extend buildFilterConditions to map FormFilterStatus.Offline to { offline: true }.
  • Extend buildFiltersFacet to use a $switch so documents with offline === true are reported as 'offline' (taking precedence over 'live'/'draft').

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/api/forms/repositories/aggregation/form-metadata-aggregation.js Use FormFilterStatus; add Offline branch in buildFilterConditions and $switch in buildFiltersFacet.
src/api/forms/repositories/aggregation/form-metadata-aggregation.test.js Update tests to use FormFilterStatus and assert new $switch aggregation.
src/api/forms/repositories/aggregation/types.js Update JSDoc typedefs for the new $or shape and FormFilterStatus.
src/api/forms/repositories/form-metadata-repository.test.js Switch test imports/usages to FormFilterStatus.
src/api/forms/service/definition.test.js Switch test imports/usages to FormFilterStatus.
src/routes/forms.test.js Update expected validation error messages to include offline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants